/**
* Copyright (c) By zengqh.
*
* This program is just for fun or demo, in the hope that it  
* will be useful, you can redistribute it and/or modify freely.
*
* Time: 2012/07/11
* File: LightSceneNode.cpp
* Blog: http://www.cnblogs.com/zengqh/
**/

#include "../RenderSystem/LightData.h"
#include "../RenderSystem/MaterialData.h"
#include "../RenderSystem/Texture.h"
#include "../RenderSystem/RenderSystem.h"
#include "CameraSceneNode.h"
#include "SceneManager.h"
#include "../RenderSystem/GraphicsBuffer.h"
#include "LightSceneNode.h"

LightSceneNode::LightSceneNode(SceneNode* parent, 
			   SceneManager* scene_mgr, 
			   s32 id,
			   s32 type,
			   const glm::vec3& position)
			   : SceneNode(parent, scene_mgr, id, type, position)
{
	_light_data._enable = true;
}

LightSceneNode::~LightSceneNode()
{

}

void LightSceneNode::setLightData(const LightData& light_data)
{
	_light_data = light_data;
}

const LightData& LightSceneNode::getLightData() const
{
	return _light_data;
}

LightData& LightSceneNode::getLightData()
{
	return _light_data;
}

void LightSceneNode::setLightType(LightType type)
{
	_light_data._type = type;
}

LightType LightSceneNode::getLightType() const
{
	return _light_data._type;
}

void LightSceneNode::render()
{
	RenderSystem* _render_system = _scene_mgr->getRenderSystem();

	_render_system->addLight(&_light_data);
}